#pragma once

#define INITGUID

#include "engineobject.h"
#include "d3dx10.h"
#include "IEngineComponent.h"

#pragma comment(linker, "/INCLUDE:??0DirectionalLightComponent@@QAE@XZ")

// {CAC049BE-E957-446e-AB84-9729A89B20D7}
DEFINE_GUID(DIRECTIONAL_LIGHT_COMPONENT_GUID, 
0xcac049be, 0xe957, 0x446e, 0xab, 0x84, 0x97, 0x29, 0xa8, 0x9b, 0x20, 0xd7);

class DirectionalLightComponent :
	public IEngineComponent
{
public:
	DirectionalLightComponent();
	DirectionalLightComponent(D3DXVECTOR3 direction, D3DXVECTOR3 color, float intensity);
	~DirectionalLightComponent(void);

	GUID getSystemIdentifier();
	GUID getComponentIdentifier();
	D3DXVECTOR3 getDirection();
	void setDirection(D3DXVECTOR3 direction);
	D3DXVECTOR3 getColor();
	void setColor(D3DXVECTOR3 color);
	float getIntensity();
	void setIntensity(float intensity);

	void Serialize(EnginePointer<ISerializerWriteContext>& context, char* name);
	static IEngineComponent* Deserialize(EnginePointer<ISerializerReadContext>& context);

	AUTO_SIZE;
private:
	D3DXVECTOR3 direction;
	D3DXVECTOR3 color;
	float intensity;
};
